<%@ page language="java" import="java.util.*,com.hs.app.model.*,com.hs.core.utils.*,com.hs.core.cache.*" pageEncoding="utf-8"%>
<%
	String periodicalname = (String)request.getAttribute("periodicalname");
	String title = (String)request.getAttribute("title"); 
	String orderName = (String)request.getAttribute("orderName");
	String orderNum = (String)request.getAttribute("orderNum"); 
	String startdate = (String)request.getAttribute("startdate");
    String enddate = (String)request.getAttribute("enddate");
    String pagenum = (String)request.getAttribute("pagenum");
    String pagecount = (String)request.getAttribute("pagecount");
    String pagestr = (String)request.getAttribute("pagestr");
    List  dataList = (List)request.getAttribute("datalist");
    String  datatype = (String)request.getAttribute("datatype"); 
    String  username = (String)request.getAttribute("username"); 
    
%>
    
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<head>
<%@ include file="../../../include.jsp"%> 
<script src='<%=basePath%>dwr/interface/dataHelper.js'></script>  
<script language="javascript" type="text/javascript" src="<%=path %>/thirtpart/My97DatePicker/WdatePicker.js"></script>


<script language=JavaScript>
  //查询
 function searchData()
{
   
	document.searchform.submit();
}
function downloadpdf(pid){
	openwindow('<%=basePath%>data/mod/downloadFile.do?pid='+pid,'0','0','');
}
function viewInfo(paperid){
    openwindow('<%=basePath%>search/viewdetail.do?pid='+paperid,'800','600','');
}

// 完成加工
function overProduce(pid){
	if(!window.confirm("是否加工完毕，进行提交?")) return;
	
	//删除合并后申请人子集中的申请人
	$.ajax({
			url:"<%=basePath%>produce/overproduce.do",
			data:{"pid":pid},
			type:"get",
			dataType:"text",
			success : function(data) {
				if(data=="success")alert("提交成功！");
				searchData();
			},
			error : function() {
				alert("提交失败！");
			}
		});
}
</script>
</head>
<body> 
<div class="cont">
<form name="searchform" action="<%=basePath %>produce/paperlist.do" method="post">  
                 <table border="0" cellpadding="0" cellspacing="0" class="tableForm">
			        <tr>
			           <td width="1%"></td>
			           <td width="5%" align=center>题名：</td>
			           <td width="10%">
			           <input type="text" name="title" value="<%=title==null?"":title %>"  style="width:90%" />
					   </td>
					   <td width="5%" align=center>刊名：</td>
			           <td width="10%">
			           <input type="text" name="periodicalname" value="<%=periodicalname==null?"":periodicalname %>" style="width:90%"/>
					   </td>
					    <td width="5%" align=center>加工员：</td>
			           <td width="10%">
			           <input type="text" name="username" value="<%=username==null?"":username %>" style="width:90%"/>
					   </td>
					   <td width="10%" align=center>导入时间从：</td>
			           <td width="8%" align=center>
			           <input type="text" class="Wdate" id="startdate" value="<%=startdate==null?"":startdate %>" style="width:90%" name="startdate"  onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'enddate\')}',el:'startdate',dateFmt:'yyyy-MM-dd'})"  />
					   </td>
					   <td width="5%" align=center>至：</td>
			           <td width="8%" align=center>
			           <input type="text" class="Wdate" id="enddate" value="<%=enddate==null?"":enddate %>" style="width:80%" name="enddate"  onFocus="WdatePicker({minDate:'#F{$dp.$D(\'startdate\')}',el:'enddate',dateFmt:'yyyy-MM-dd'})"  />
					   </td> 
					   <td width="5%"><input name="" type="button" class="btn btn-primary"  onclick="searchData();"  value=" 查 询 "/></td>
					 
					   <td width="1%"></td>
			        </tr> 
			          
			      </table>  
</form>
    <div class="listWrap">
     
       <table border="0" cellpadding="0" cellspacing="0" class="tableList">
       <form name="dataform" action="<%=basePath %>data/mod/exportData.do?1=1" method="post">
      
        <th width="5%">
         选择
        </th> 
        <th width="20%"><a href="javaScript:orderPage('title','<%=OrderTool.getOrderNum("title",orderName,orderNum)%>');">题名&nbsp;&nbsp;<%=OrderTool.getOrderImage(basePath,OrderTool.getOrderNum("title",orderName,orderNum))%></a></th> 
        <th width="10%"><a href="javaScript:orderPage('author','<%=OrderTool.getOrderNum("author",orderName,orderNum)%>');">作者&nbsp;&nbsp;<%=OrderTool.getOrderImage(basePath,OrderTool.getOrderNum("author",orderName,orderNum))%></a></th>
        <th width="20%">作者单位</th> 
        <th width="10%">刊名</th>
        <th width="8%">发表时间</th> 
        <th width="5%">状态</th> 
        <th width="7%">加工员</th> 
        <th width="20%">操作</th>
      </tr>
      <%if(null != dataList&&dataList.size()>0){
      		for(int i =0;i<dataList.size();i++){
      			Map paper = (Map)dataList.get(i); 
       %>
      <tr>
        <td class="tac" nowrap> 
         <%=(15*(Integer.parseInt(pagenum)-1))+i+1 %>
        </td>
        <td><%=paper.get("title") %></td>  
        <td><%=StringUtilTool.NULL2Blank(paper.get("author")+"") %></td>
        <td><%=StringUtilTool.NULL2Blank(paper.get("authorunit")+"") %></td> 
        <td><%=StringUtilTool.NULL2Blank(paper.get("periodicalname")+"") %></td>
        <td class="tac"><%=StringUtilTool.NULL2Blank(paper.get("yearstr")+"") %></td>
         <td class="tac">
         	<%
         		Object status = paper.get("status");
         		if(null == status || "".equals(status)|| "0".equals(status)){%>
         		<font color=red>未加工</font>
         	<% }else if("1".equals(status.toString())){ %>
         		<font color=red>加工中</font>
         	<%}else if("2".equals(status.toString())){ %>
         		<font color=red>加工完</font>
         	<%} %>
         </td>
         <td><%=StringUtilTool.NULL2Blank(paper.get("puser")+"") %></td>
         <td class="tac">
         	<a href="javaScript:viewInfo('<%=paper.get("ID")%>');">查看</a>
         	<%if(null != status && "2".equals(status.toString())){ %>
         	 &nbsp;&nbsp;&nbsp;&nbsp;<span style="color: gray;">开始加工</span>
        	 &nbsp;&nbsp;&nbsp;&nbsp;<span style="color: gray;">完成提交</span>
         	<%}else{ %>
        	 &nbsp;&nbsp;&nbsp;&nbsp;<a href="<%=basePath%>produce/startproduce.do?pid=<%=paper.get("ID")%>">开始加工</a>
        	 &nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:overProduce('<%=paper.get("ID")%>');">完成提交</a>
    		<%} %>
    	</td>
      </tr>
      
      <%}}else{ %>
      <tr>
        <td class="tac" colspan=9><font color=red><strong>没有待加工的文献!</strong></font></td>
      </tr> 
      <%} %>
    </table>
    </form>
    <div class="pageWrap">
        <div class="result"></div>
        <div class="page">
              <%=pagestr %>
        </div>
    </div>
    </div> 
</div>
</body>
</html>